package memory;

import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;

public class MemoryMain  {
	private Stage primaryStage;
	public MemoryMain() {
		try {
			 primaryStage = new Stage();
			FXMLLoader loader = new FXMLLoader();
			loader.setLocation(getClass().getResource("/memory/MemoryUI.fxml"));
			Parent root = (Parent)loader.load();
			Scene scene = new Scene(root);
			primaryStage.setScene(scene);
			primaryStage.setTitle("memory");
			primaryStage.setResizable(false);
			primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
		            @Override
		            public void handle(WindowEvent event) {
		    	        primaryStage.hide();
		            }
		          });
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	  public void setprimaryStage() {
		   this.primaryStage.show();
	}
}